<%@ page contentType="text/html;charset=utf-8" language="java"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@include file="./common/base.jsp" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>用户中心_约导游</title>
<!--css-->
<link rel="stylesheet" type="text/css" href="css/wutongstyle.css">
<script src="js/rating.js" type="text/javascript"></script>

</head>
<body>
<!--head begin-->
<%@ include  file="./common/header.jsp"%>
<!--nav end--> 
<!--content begin-->
<div class="wt_content">
  <dl class="yuedaoyou">
	<%@ include  file="./common/header1.jsp"%>
    <dd>
      <div class="daoyou_info clearfix">
        <div class="xx_box">
          <div class="tainfobox yonghu">
            <h3 id="tuan"><i class="i_co"></i>评价团发起人</h3>
            <div class="tainfo">
              <ul class="daituan2">
                <li>
                  <!--  <div class="tupian"><a href="lxinfo.html"><img src="wutongimages/tuan4.jpg"/></a></div>-->
                  <div class="xiangqing"><a target="_blank" href="javascript:void(0)" id="teamjumpId">
                    <h2 id="team1Id"></h2>
                    </a>
                    <pre id="teamTripId" style="word-wrap:break-word; word-break:break-all;"></pre>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="biaodan bddy">
                     <!--   <tr>
                        <td colspan="3" class="bddytitle">本团发起人相关信息</td>
                      </tr>
                      <tr>
                        <td rowspan="5" align="center" valign="top"><a href="dyinfo.html" target="_blank">
                         <img src="" width="100" style="margin:10px;" id="travelorgPhotoId"/></a></td>
                        <td class="title">旅行社：</td>
                        <td id="travelorgNameId"></td>
                      </tr>
                      <tr>
                        <td class="title">资格证号：</td>
                        <td id="travelorgLicnumId"></td>
                      </tr>
                      <tr>
                        <td class="title">此次评价：</td>
                        <td>
                      		<span  id="lblStar1"></span>
                          <br />
                          <textarea id="commentsId" name="" cols="" rows="" style="height:100px;"></textarea></td>
                      </tr>
                      <tr>
                        <td>&nbsp;</td>
                        <td><button type="button" value="确认" onclick="commentsTravel()">确认</button></td>
                      </tr>-->
                      
                                <tbody><tr>
                        <td colspan="3" class="bddytitle">合作互评</td>
                      </tr>
                      <tr>
                        <td width="200" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tbody><tr>
                              <td align="center"><a href="javascript:void(0);" target="_blank" id="showStrId"><img id="travelorgPhotoId" src="" width="100" style="margin:10px;"></a>
                               <a href="javascript:void(0)" id="fasixinId"><h5 style="color:green">发私信</h5>
                              </td>
                            </tr>
                            <tr>
                              <td align="center" id="travelorgNameId"></td>
                            </tr>
                            <tr>
                              <td align="center" id="travelorgLicnumId"></td>
                            </tr>
                          </tbody></table></td>
                        <td valign="top" class="tbpj"><table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tbody><tr>
                              <td class="pj_line">来自发团客户的评价：</td>
                            </tr>
                            <tr style="display:none;" id="duifangDefId">
                              <td><div class="tishi">对方客户（旅行社或个人）尚未对您有任何评价！</div></td>
                            </tr>
                            <tr style="display:none;" id="duifangId">
                              <td class="pj_red" ><br><span id="duifangstarId"></span>
                            <pre style="font-size:12px;word-wrap:break-word; word-break:break-all;width:85%;"  id="duifangstrId"></pre></td>
                            </tr>
                            <tr>
                              <td class="pj_line">我要评价本团的客户（旅行社或个人）：</td>
                            </tr>
                            <tr>
                              <td><br><t id="benfangstarId"></t><br><br>
                                <textarea name="" cols="" rows="" style="word-wrap:break-word; word-break:break-all;height:100px;" id="commentsId"></textarea></td>
                            </tr>
                            <tr>
                              <td><button type="button" value="确认" onclick="commentsTravel()">确认</button></td>
                            </tr>
                          </tbody></table></td>
                      </tr>
                    </tbody>
                    </table>
                  </div>
                </li>
              </ul>
            </div>
          </div>
        </div>
        <div class="zp"><img id="headImgId" src="" width="185" height="185" />
          <div class="tel">
            <h4>快捷菜单</h4>
            <ul class="quick">
              <li><a href="dylogin_5.jsp" >最新发团信息</a></li>
              <li><a href="dylogin_1.jsp">已申请的团</a></li>
              <li><a href="dylogin_6.jsp" >已确认的团</a></li>
              <li><a href="dylogin_2.jsp" class="on">已带队的团</a></li>
              <li><a href="dylogin_7.jsp" >团信息列表</a></li>
              <li><a href="dylogin_3.jsp" >我的资料</a></li>
              <li><a href="dylogin_4.jsp">站内短信列表</a></li>
 
            </ul>
          </div>
          
        </div>
      </div>
    </dd>
  </dl>
</div>
<!--content end--> 
<!--footer begin-->
<%@ include  file="./common/footer.jsp"%>
<!--footer end-->
</body>
<script type="text/javascript">
var teamId = request("teamId");
var travelorgId = request("travelorgId");
var guideId=loginUserDetailId;
$(function(){
	$("#headImgId").attr("src",imgDomain+loginUserPhoto);
	loadLxsTeamList(teamId);
	loadLxsInfoList(travelorgId);
	InitStar(5,1,'image/nostar.png','image/activeStar.png','benfangstarId','txt')
	loadduifangInfo();
});

function commentsTravel(){
	var score=$("#benfangstarId").attr("star");
	var objp= "{\"teamId\":\""+teamId+"\","+
	"\"score\":\""+score+"\","+
    "\"comments\":\""+escape($("#commentsId").val())+"\""+
    "}";
	$.ajax({
	 url: '${path}/core/commentTravelTeam',
	 type: 'POST',
	 timeout: 30000,
	 cache : false,
	 data :objp,
	 async: false,
	 dataType:"json",      
	 contentType:"application/json",   
	// contentType: "application/json; charset=utf-8",
	 success:function(msg){
		  //alert(msg.totalCount)
		  alert("ok");history.go(-1);
	 },
	  failure:function(msg){
		   alert(eval('('+msg.responseText+')').error_text);
	  		
	  },
	  error:function(msg){
		   alert(eval('('+msg.responseText+')').error_text); 
	  }
	});
}
function loadLxsTeamList(id) {
	var objp= {};
	   $.ajax({
			  url: '${path}/core/getTravelTeamByTeamId?teamId='+id,
			  type: 'POST',
			  timeout: 30000,
			  cache : false,
		      data :objp,
		      async: false,
		      dataType:"json",      
	          contentType:"application/json",   
		     // contentType: "application/json; charset=utf-8",
			  success:function(msg){
				  var teamData = msg.travelTeam;
				  $('#teamjumpId').attr('href','lxinfo.jsp?teamId='+id); 
				  $("#team1Id").html("<span>出发地点："+teamData.sourcecity+" | 目的地："+teamData.targetcity+" | 出发时间："+teamData.startTime+"</span>"+teamData.teamtitle);
				  $("#teamTripId").html(teamData.trip);
			  },
			   failure:function(msg){
				   alert(eval('('+msg.responseText+')').error_text);
			   		
			   },
			   error:function(msg){
				   alert(eval('('+msg.responseText+')').error_text); 
			   }
		});
}
function loadLxsInfoList(id) {
	var objp= {};
	   $.ajax({
			  url: '${path}/core/getTravelorgById?travelorgId='+id,
			  type: 'POST',
			  timeout: 30000,
			  cache : false,
		      data :objp,
		      async: false,
		      dataType:"json",      
	          contentType:"application/json",   
		     // contentType: "application/json; charset=utf-8",
			  success:function(msg){
				  var travelorgData = msg.travelorg;
				  $("#travelorgNameId").html(travelorgData.name);
				  $("#travelorgLicnumId").html(travelorgData.licnum);
				  $("#travelorgPhotoId").attr("src",imgDomain+travelorgData.photo);
				  if(travelorgData.userType==0){
					  $("#showStrId").attr("href","lxsinfo.jsp?travelorgId="+travelorgData.id);
				  }else if(travelorgData.userType==1) {
					  $("#showStrId").attr("href","grinfo.jsp?personalId="+travelorgData.id);
				  }
				  $("#fasixinId").attr("href","dylogin_4_fabu.jsp?recUserName="+travelorgData.userName+"&recName="+escape(travelorgData.name));

				  
			  },
			   failure:function(msg){
				   alert(eval('('+msg.responseText+')').error_text);
			   		
			   },
			   error:function(msg){
				   alert(eval('('+msg.responseText+')').error_text); 
			   }
		});
}
function loadduifangInfo(){
	var objp={};
	$.ajax({
		 url: '${path}/core/getCommentGuideByTeamId?teamId='+teamId+"&guideId="+guideId,
		 type: 'POST',
		 timeout: 30000,
		 cache : false,
		 data :objp,
		 async: false,
		 dataType:"json",      
		 contentType:"application/json",   
		// contentType: "application/json; charset=utf-8",
		 success:function(msg){
			  //alert(msg.totalCount)
			  var commentData = msg.comments;
			  if(commentData) {
				  //$("#lblStar1").attr("star",commentData.score);
				  //showStar("lblStar1",commentData.score)
				   document.getElementById("duifangId").style.display="block";
				  InitStar(5,commentData.score,'image/nostar.png','image/activeStar.png','duifangstarId','txt')
				  var comstr="无评论内容";
				  if(commentData.comments){
					  comstr = commentData.comments;
				  }
				  $("#duifangstrId").html(comstr);
			  }else{
				  document.getElementById("duifangDefId").style.display="block";
			  }
			
			  
		 },
		  failure:function(msg){
			   alert(eval('('+msg.responseText+')').error_text);
		  		
		  },
		  error:function(msg){
			   alert(eval('('+msg.responseText+')').error_text); 
		  }
		});
}
</script>
</html>
